import Storage from 'storage';

export default {
  setUserData(state, user) {
    state.user = user;
    Storage.setSession('user', user);
  },

  setDefaultUserData(state, defaultUser) {
    state.defaultUser = defaultUser;
    Storage.setSession('defaultUser', defaultUser);
  },

  setLocationData(state, location){
    state.location = location;
    Storage.setSession('location', location);
  },

  setAuthTokenData(state, authToken) {
    state.authToken = authToken;
    Storage.setLocal('authToken', authToken);
  },

  setRefreshTokenData(state, refreshToken) {
    state.refreshToken = refreshToken;
    Storage.setLocal('refreshToken', refreshToken);
  },

  setWidthData(state, width) {
    state.width = width;
  },

  setHeightData(state, height) {
    state.height = height;
  }
}
